﻿/*
*	冰火家族萬能NPC
*
*
*
*
*
*/
var x = "#fEffect/CharacterEff/1112949/0/0#";//高音譜記號
var kk = "#fEffect/BasicEff/MainNotice/Boss/Default/0#";//BOSS
var c = "#fEffect/CharacterEff/1032063/0/0#";//"#fUI/UIMiniGame/starPlanetRPS/heart#";//愛心
var cmark = "#fUI/UIPVP/ChampionMark/1#";//愛心
var lb = "#fEffect/ItemEff/1112811/0/0#";//藍色小光
var b = "#fEffect/CharacterEff/Shaman/1#";//超萌熊熊
var cat = "#fEffect/CharacterEff/Shaman/4#";//超萌喵咪
var leaf = "#fUI/Basic.img/Cursor/18/0#";
var status;

var menuList = Array(
        Array(lb, "補給商店", 0, true),
		Array(lb, "每日特賣", 14, true),
		Array(lb, "BOSS硬幣", 11, true),
		Array(lb, "#b楓葉套裝", 8, true),
		Array(lb, "#b傷害造型", 9, true),
		Array(lb, "#b現金百貨", 5, true),
		Array(lb, "#b潛能專賣", 6, true),
		Array(lb, "#b強化工坊", 7, true),
		Array(lb, "#rRED 商店", 1, true),
		Array(lb, "#r征服商店", 2, true),
		Array(lb, "#r獅王商店", 3, true),
		Array(lb, "#r暴君商店", 4, true),
		Array(lb, "#r外星商店", 10, true),
		Array(lb, "#r戰國硬幣", 12, true),
		Array(lb, "#r使鳥代幣", 13, true)
		);
function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {

    if (mode == 0) {
	cm.dispose();
	return;
    } else if (mode == 1){
	status++;
    } else {
	status--;
    }

    switch (status) {
        case 0: 
			text = "\t  "+c+"#fn华文行楷##fs30##e#k #b百貨公司 " +c+ "\r\n#fs12##fn宋体#";
			
			var ccc = 0;
			for (var i = 0; i < menuList.length; i++) {
				if(ccc%3 == 0)
					text +="\r\n   ";
				if (menuList[i][3]) { // 如果允许显示
					text += "#d#L" + menuList[i][2] + "#" + menuList[i][0] + menuList[i][1] + "#l";
					ccc++;
				}
			}
			text += "\r\n\r\n\t\t   #L999#" + leaf +"#fn华文行楷##fs22##e#r回上一頁#l"
			text += "\r\n\r\n  " +c+c+c+c+c+c;
			cm.sendSimple(text);
            break;
        case 1: //
			switch (selection){
				case 0://補給商店
					cm.dispose();
					cm.openShop(61);
					break;
				case 1://RED 商店
					cm.dispose();
					cm.openShop(69);
					break;
				case 2://征服商店
					cm.dispose();
					cm.openShop(350);
					break;
				case 3://師王商店
					cm.dispose();
					cm.openShop(5206);
					break;
				case 4://暴君商店
					cm.dispose();
					cm.openShop(5207);
					break;
				case 10://外星商店
					cm.dispose();
					cm.openShop(5209);
					break;
				case 11://BOSS硬幣
					cm.dispose();
					cm.openShop(5210);
					break;
				case 12://戰國硬幣
					cm.dispose();
					cm.openShop(5212);
					break;
				case 13://使鳥硬幣
					cm.dispose();
					cm.openShop(5211);
					break;
				case 5://現金百貨
					cm.dispose();
					cm.openNpc(1052253,'CashShop');
					break;
				case 6://方塊專賣
					cm.dispose();
					cm.openNpc(1052253,'CubeShop');
					break;
				case 7://強化工坊
					cm.dispose();
					cm.openNpc(1052253,'ScrollShop');
					break;
				case 8://楓葉套裝
					cm.dispose();
					cm.openNpc(1052253,'maple');
					break;
				case 9://傷害造型
					cm.dispose();
					cm.openNpc(1052253,'Damage_Skin');
					break;
				case 14://每日特賣
					cm.dispose();
					cm.openNpc(2008,1001);
					break;
				case 999://回上一頁
					cm.dispose();
					cm.openNpc(1052253);
					break;
				default:
					cm.sendOk(menuList[selection][1] + " 正在籌備中!敬請期待。");
					cm.dispose();
					break;
			}
            break;
        default:
			cm.sendOk("發生錯誤，請聯繫管理員!");
			cm.dispose();
			break;
    }
}
